<template>
  <div>
    <!-- 
      ref属性
        1 普通元素
          ref和id作用一致

        2 组件
          ref拿到的是VueComponent的实例化对象vc
          id拿到的是组件的真实dom结构
      作用
        用来给元素或子组件注册引用信息(id的替代者)
     -->
    <h1 ref="info">信息</h1>
    <School ref="sch" id="sch"></School>
    <Student></Student>
  </div>
</template>

<script>
import School from './components/School'
import Student from './components/Student'
export default {
  name: 'App',
  components: {
    School,
    Student
  },
  mounted() {
    console.log(this.$refs.info)
    console.log(this.$refs.sch)
    console.log(document.getElementById('sch'))
  }
}
</script>
